package com.zlcx.tz.live.domain;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.Data;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import java.io.Serializable;

/**
 * @author shixiaopeng
 *
 * 连麦开关--针对创建房间和申请上麦
 */
@Data
@Entity(name = "tz_live_switch")
@JsonSerialize
@DynamicUpdate
@DynamicInsert
public class LiveSwitched implements Serializable {

    private static final long serialVersionUID = -3210975848079627189L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
    /**
     * 开关， 1开，0关
     */
    private Integer switched;

    public enum SwitchEnum{
        ON(1, "拒绝连麦"),
        OFF(0, "允许连麦");

        public final Integer code;
        public final String desc;
        SwitchEnum(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }


    }
}